import Vue from "vue";
import VueRouter from "vue-router";
import Appointments from "../views/Appointments.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Appointments",
    component: Appointments
  },
  {
    path: "/about",
    name: "About",
    component: () => import("../views/About.vue")
  },
  {
    path: "/search",
    name: "Search",
    component: () => import("../views/Search.vue")
  },
  {
    path: "/intake",
    name: "Intake",
    component: () => import("../views/Intake.vue")
  },
  {
    path: "/profile",
    name: "Profile",
    component: () => import("../views/Profile.vue")
  },
  {
    path: "/record",
    redirect: "/search"
  },
  {
    path: "/record/:id",
    name: "Record",
    component: () => import("../views/Record.vue"),
    props: true
  },
  {
    path: "/record/:id/:entry_id",
    name: "Entry",
    component: () => import("../views/Record.vue"),
    props: true
  },
  {
    path: "/appointment",
    redirect: "/"
  },
  {
    path: "/logout",
    name: "Logout",
    component: () => import("../views/Logout.vue")
  }
];

const router = new VueRouter({
  // base: "/apps/appointments_alternate",
  routes
});

export default router;
